import sys
from PyQt5.QtWidgets import (QWidget, QToolTip, QDesktopWidget, QMessageBox,QTextEdit,QLabel,
    QPushButton, QApplication,QMainWindow, QAction, qApp, QHBoxLayout, QVBoxLayout,QGridLayout,
    QLineEdit)
from PyQt5.QtGui import QFont,QIcon
from PyQt5.QtCore import QCoreApplication
 

# ##***文本审阅***## #
class TextReview(QWidget):
    def __init__(self):
        super().__init__()
 
        self.initUI()
 
    def initUI(self):
        title = QLabel('Title')
        author = QLabel('Author')
        review = QLabel('Review')
 
        titleEdit = QLineEdit()
        authorEdit = QLineEdit()
        reviewEdit = QTextEdit()
 
        grid = QGridLayout()
        grid.setSpacing(10) # 创建了一个网格布局并且设置了组件之间的间距。
 
        grid.addWidget(title, 1, 0)
        grid.addWidget(titleEdit, 1, 1)
 
        grid.addWidget(author, 2, 0)
        grid.addWidget(authorEdit, 2, 1)
 
        grid.addWidget(review, 3, 0)
        grid.addWidget(reviewEdit, 3, 1, 5, 1) # 如果我们向网格布局中增加一个组件，我们可以提供组件的跨行
        # 和跨列参数。在这个例子中，我们让reviewEdit组件跨了5行。
 
        self.setLayout(grid)
 
        self.setGeometry(300, 300, 350, 300)
        self.setWindowTitle('Review')
        self.show()
         
         
if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = TextReview()
    sys.exit(app.exec_())